#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File    :   mysql_sample.py    
@Contact :   291622538@qq.com

@Modify Time      @Author    @Version    @Description
------------      -------    --------    -----------
2021/3/31 15:10   fan        1.0         None
"""
import pymysql

# 建立数据库连接
conn = pymysql.connect(
    # 服务器
    host='192.168.xxx.x',
    port=3306,
    user='root',
    password='xxx',
    # 数据库名
    db='manage_domain',
    charset='utf8'
)

# 获取游标
cursor = conn.cursor()

if __name__ == '__main__':
    sql = ""
    rows = cursor.execute(sql)  # 返回结果是受影响的行数
    conn.commit()
